package org.jeecg.modules.demo.com.kunpeng.Utils;

import org.jeecg.modules.demo.com.kunpeng.entity.CustomerInformation;
import org.jeecg.modules.demo.com.kunpeng.vo.OtherContractPage;
import org.jeecg.modules.demo.com.kunpeng.vo.PurchaseContractPage;
import org.jeecg.modules.demo.com.kunpeng.vo.SaleContractPage;

/**
 * 前端传过来的客户信息赋值到客户实体类
 */
public class CustomerInformationUtils {

    /**
     * 销售合同客户信息
     * @param saleContractPage
     * @return
     */
    public static CustomerInformation assignmentSaleContractCustomerInformation(SaleContractPage saleContractPage){
        CustomerInformation customerInformation=new CustomerInformation();
        customerInformation.setCustomerName(saleContractPage.getCustomerName());
        /*customerInformation.setCustomerContracts(saleContractPage.getCustomerContacts());
        customerInformation.setCustomerTelephone(saleContractPage.getCustomerTelephone());*/
        customerInformation.setCustomerAddress(saleContractPage.getCustomerAddress());
        return customerInformation;
    }

    /**
     * 采购合同客户信息
     * @param purchaseContractPage
     * @return
     */
    public static CustomerInformation assignmentPurchaseContractCustomerInformation(PurchaseContractPage purchaseContractPage){
        CustomerInformation customerInformation=new CustomerInformation();
        customerInformation.setCustomerName(purchaseContractPage.getSupplierName());
        /*customerInformation.setCustomerContracts(purchaseContractPage.getCustomerContacts());
        customerInformation.setCustomerTelephone(purchaseContractPage.getCustomerTelephone());*/
        customerInformation.setCustomerAddress(purchaseContractPage.getCustomerAddress());
        return customerInformation;
    }

    /**
     * 其他合同客户信息
     * @param otherContractPage
     * @return
     */
    public static CustomerInformation assignmentOtherContractCustomerInformation(OtherContractPage otherContractPage){
        CustomerInformation customerInformation=new CustomerInformation();
        customerInformation.setCustomerName(otherContractPage.getSeller());
        /*customerInformation.setCustomerContracts(otherContractPage.getCustomerContacts());
        customerInformation.setCustomerTelephone(otherContractPage.getCustomerTelephone());*/
        customerInformation.setCustomerAddress(otherContractPage.getCustomerAddress());
        return customerInformation;
    }


}
